package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.domain.StrategyLike;
import cn.wolfcode.trip.base.query.LikeQueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyLikeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyLike record);

    StrategyLike selectByPrimaryKey(Long id);

    List<StrategyLike> selectAll();

    int updateByPrimaryKey(StrategyLike record);

    /**
     * 根据攻略的id,查询该攻略的点赞条数
     * @param strategyId
     * @return
     */
    int countStrategyLike(Long strategyId);

    List<Long> selectAllUserId(Long strategyId);

    /**根据用户的id和攻略的id删除点赞信息
     * @param strategyId
     * @param userId
     */
    void deleteByUserIdAndStrategyId(@Param("strategyId") Long strategyId, @Param("userId") Long userId);
    /**
     * 取消评论点赞
     * @param commentId
     */
    void deleteByUserIdAndCommentId(@Param("commentId") Long commentId, @Param("userId") Long userId);

    List<Long> selectAllCommentUserId(Long commentId);

    int selectByCommentIdLike(Long commentId);

    int countForLikeMe(@Param("userId") Long userId);

    /**
     * 查询指定id评论下的点赞的用户信息
     * @return 用户点赞信息的集合
     */
    List<StrategyLike> ListForLikeComment(LikeQueryObject qo);

    /**
     * 获取评论我的纤细条数
     * @param userId 当前用户的id
     * @return 条数
     */
    int countForCommentMe(Long userId);
     //改变点赞条数的状态
    void updateLikeState(Long id);
}